From: Suravee Suthikulpanit Date: Mon, 29 Aug 2016 14:05:31 +0000 (+0200) Subject: x86/HVM: add guarding logic for VMX specific code X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~510 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=81caac0cd0f56b0052a7884e6bd99e3a652ddd59;p=xen.git x86/HVM: add guarding logic for VMX specific code The struct hvm_domain.vmx is defined in a union along with the svm. This can causes issue for SVM since this code is used in the common scheduling code for x86. The logic must check for cpu_has_vmx before accessing the hvm_domain.vmx sturcture. Signed-off-by: Suravee Suthikulpanit Acked-by: Jan Beulich --- diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h index 314881a735..5d463e0eff 100644 --- a/xen/include/asm-x86/hvm/hvm.h +++ b/xen/include/asm-x86/hvm/hvm.h @@ -611,7 +611,7 @@ unsigned long hvm_cr4_guest_reserved_bits(const struct vcpu *v, bool_t restore); struct vcpu *v_ = (v); \ struct domain *d_ = v_->domain; \ if ( has_hvm_container_domain(d_) && \ - d_->arch.hvm_domain.vmx.vcpu_block ) \ + (cpu_has_vmx && d_->arch.hvm_domain.vmx.vcpu_block) ) \ d_->arch.hvm_domain.vmx.vcpu_block(v_); \ })